<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:58:"E:\xampp\htdocs\yx\public/../app/admin\view\room\edit.html";i:1531711568;s:60:"E:\xampp\htdocs\yx\public/../app/admin\view\common\base.html";i:1523866229;s:59:"E:\xampp\htdocs\yx\public/../app/admin\view\common\nav.html";i:1523511755;}*/ ?>
<!DOCTYPE html>
<html lang="zh_ch">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">
    <title>后台管理系统</title>
    <link href="/favicon.ico" rel="icon" type="image/x-icon" />
    <link href="__CSS__/style.css" rel="stylesheet">
    <!--<link href="__CSS__/bootstrap.min.css" rel="stylesheet">-->
    <link href="__CSS__/style-responsive.css" rel="stylesheet">
    
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="__JS__/html5shiv.js"></script>
    <script src="__JS__/respond.min.js"></script>
    <![endif]-->
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <div class="left-side sticky-left-side">

        <!--logo start-->
        <div class="logo">
            <a href="<?php echo url('Index/index'); ?>"><img src="__IMG__/logo.png" alt=""></a>
        </div>

        <div class="logo-icon text-center">
            <a href="<?php echo url('Index/index'); ?>"><img src="__IMG__/logo_icon.png" alt=""></a>
        </div>
        <!--logo  end-->


        <div class="left-side-inner">

            <!-- visible to small devices only -->
            <div class="visible-xs hidden-sm hidden-md hidden-lg">
                <div class="media logged-user">
                    <img alt="" src="__IMG__/photos/user-avatar.png" class="media-object">
                    <div class="media-body">
                        <h4><a><?php echo session('admin_login.username'); ?></a></h4>
                    </div>
                </div>
                <ul class="nav nav-pills nav-stacked custom-nav">
                    <li><a  data-toggle="modal" href="#myModal"><i class="fa fa-cog"></i> <span>修改密码</span></a></li>
                    <li><a href="<?php echo url('Login/out'); ?>"><i class="fa fa-sign-out"></i> <span>退出</span></a></li>
                </ul>
            </div>

            <!--左侧菜单 start-->
<ul class="nav nav-pills nav-stacked custom-nav">

    <?php if(is_array($menu_list) || $menu_list instanceof \think\Collection || $menu_list instanceof \think\Paginator): if( count($menu_list)==0 ) : echo "" ;else: foreach($menu_list as $key=>$vo): if(!(empty($vo['sub_menu']) || (($vo['sub_menu'] instanceof \think\Collection || $vo['sub_menu'] instanceof \think\Paginator ) && $vo['sub_menu']->isEmpty()))): ?>
            <li class="menu-list <?php if(($controllerName == $vo['control'])): ?>nav-active<?php endif; ?>"><a href="#"><i class="fa <?php echo $vo['icon']; ?>"></i><span><?php echo $vo['name']; ?></span></a>
                <ul class="sub-menu-list">
                    <?php if(is_array($vo['sub_menu']) || $vo['sub_menu'] instanceof \think\Collection || $vo['sub_menu'] instanceof \think\Paginator): if( count($vo['sub_menu'])==0 ) : echo "" ;else: foreach($vo['sub_menu'] as $kk=>$vv): ?>
                    <li <?php if(($actionName == $vv['act'])): ?> class="active" <?php endif; ?>><a href="<?php echo url("$vv[control]/$vv[act]"); ?>"><?php echo $vv['name']; ?></a></li>
                   <?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </li>
             <?php else: ?>
            <li class="menu-list}">
            <a href="<?php echo url("$vo[control]/$vo[act]"); ?>""><i class="fa <?php echo $vo['icon']; ?>"></i><span><?php echo $vo['name']; ?></span></a>
            </li>
      <?php endif; endforeach; endif; else: echo "" ;endif; ?>

</ul>
<!--左侧菜单 end-->

        </div>
    </div>
    <!-- left side end-->

    <!-- main content start-->
    <div class="main-content" >

        <!-- header section start-->
        <div class="header-section">

            <!--toggle button start-->
            <a class="toggle-btn"><i class="fa fa-bars"></i></a>
            <!--toggle button end-->

            <!--notification menu start -->
            <div class="menu-right">
                <ul class="notification-menu">

                    <li>
                        <a href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            <img src="__IMG__/photos/user-avatar.png" alt="" />
                            <?php echo session('admin_login.username'); ?>
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                            <li><a  data-toggle="modal" href="#myModal"><i class="fa fa-cog"></i> <span>修改密码</span></a></li>
                            <li><a href="<?php echo url('Login/out'); ?>"><i class="fa fa-sign-out"></i>退出</a></li>
                        </ul>
                    </li>

                </ul>
            </div>
            <!--notification menu end -->

        </div>
        <!-- header section end-->
        <!--提示信息-->
        <div id="top-alert" class="fixed alert alert-error">
            <button class="close fixed">&times;</button>
            <div class="alert-content">提示信息</div>

        </div>
        <!--提示信息end-->
        
<!--body wrapper start-->
<div class="wrapper">
    <div class="pull-left">
        <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
    </div>
    <div class="row">
        <div class="col-md-12">
            <!--breadcrumbs start -->
            <ul class="breadcrumb panel">
                <li><a href="<?php echo url('Index/index'); ?>"><i class="fa fa-home"></i> 控制台</a></li>
                <li><a href="<?php echo url('index'); ?>">房间管理</a></li>
                <li class="active">房间编辑</li>
            </ul>
            <!--breadcrumbs end -->
        </div>
    </div>

    <div class="panel-body">
        <form method="post" action="" class="form-horizontal bucket-form">
            <div class="form-group">
                <label class="col-sm-1 control-label">房间号</label>
                <div class="col-sm-3">
                 <input type="text" class="form-control" name="room_number" value="<?php echo $data['room_number']; ?>" size="60">
                </div>
            </div>
            <div class="form-group ">
                <label class="col-sm-1 control-label">图片</label>
                <div class="col-sm-11">
                    <p class="bor_b left mg_tb10" id="demo3">
                           <img height="100px" class="first"  src="<?php echo $data['back_url']; ?>"/>
                        <p class="bor_b left mg_tb10" >
                            <input type="file" id="file" class="playUrl"   src=""/>
                        </p>
                        <p class="bor_b left mg_tb10" >
                            <button class="btn btn-success qiniu">点击上传</button>
                            <input type="hidden" class="second" name="back_url" value="<?php echo $data['back_url']; ?>"/>
                        </p>

                    </p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">关键词</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="key_words" value="<?php echo $data['key_words']; ?>" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">热度</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="hot" value="<?php echo $data['hot']; ?>" >
                </div>
            </div>
            <input type="hidden" name="id" value="<?php echo $data['id']; ?>">
            <div class="form-group">
                <label class="col-sm-1 control-label"></label>
                <div class="col-lg-10 right">
                    <button class="btn btn-primary " target-form="bucket-form"  type="submit">保存</button>
                </div>
            </div>
        </form>
    </div>
</div>

<!--body wrapper end-->

        <!--footer section start-->
        <footer class="sticky-footer">
            2014-2017 ©
            成都汤沐科技有限公司出品
        </footer>
        <!--footer section end-->

    </div>
    <!-- main content end-->
</section>

<!-- Modal -->
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <!--<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>-->
                <h4 class="modal-title">修改密码</h4>
            </div>
            <form class="form-horizontal form-post" action="<?php echo url('member/edit_pass'); ?>" method="post">
            <div class="modal-body">
                <div class="form-group">
                    <label  class="col-lg-2 col-sm-2 control-label">原密码</label>
                    <div class="col-lg-10">
                        <input type="password" name="old" class="form-control"  placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-lg-2 col-sm-2 control-label">新密码</label>
                    <div class="col-lg-10">
                        <input type="password" name="password" class="form-control"  placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-lg-2 col-sm-2 control-label">确认密码</label>
                    <div class="col-lg-10">
                        <input type="password" name="passwords" class="form-control"  placeholder="">
                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
                <button class="btn btn-primary" type="submit" target-form="form-post">提交</button>
            </div>
            </form>
        </div>
    </div>
</div>
<!-- modal -->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="__JS__/jquery-1.10.2.min.js"></script>
<script src="__JS__/jquery-ui-1.9.2.custom.min.js"></script>
<script src="__JS__/jquery-migrate-1.2.1.min.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/modernizr.min.js"></script>
<script src="__JS__/jquery.nicescroll.js"></script>
<script src="__JS__/layer/layer.js"></script>


<script type="text/javascript" src="__JS__/layer/layer.js"></script>
<script type="text/javascript" src="https://unpkg.com/qiniu-js@v2.4.0/dist/qiniu.min.js"></script>
<script>
    $('.qiniu').click(function () {
        var btn = $(this);
        btn.attr('disabled', 'disabled');
        layer.msg('上传中', {
            icon: 16
            ,shade: [0.3,'#999999'],
            time:21600000
        });
        var token = "<?php echo $token; ?>";
        var file = $('#file')[0].files[0];
        var index = file.name.lastIndexOf(".");
        var ext = file.name.substring(index);
        var key = takeName('vod',2)+ext;
        var config = {
            useCdnDomain: true,
            region: qiniu.region.z0
        };
        var putExtra = {
            fname: file.name,
            params: {},
            mimeType:  null
        };
        var observer = {
            next(res){
                $('.layui-layer-padding').html('<i class="layui-layer-ico layui-layer-ico16"></i>上传中 '+res.total.percent.toFixed(2)+'%');
            },
            error(err){
                layer.msg('上传失败,请稍后重试'+err.message, {icon: 5, time: 2000});
                layer.closeAll("loading");
                btn.attr('disabled', false);
            },
            complete(res){
                var domain = "<?php echo $domain; ?>";
                var url = domain+'/'+res.key;
                console.log(url);
                $(".first").attr('src',url);
                $(".second").val(url);
                layer.msg('上传成功', {icon: 1, time: 2000});
                layer.closeAll("loading");
                btn.attr('disabled', false);
            }
        };
        var observable = qiniu.upload(file, key, token, putExtra, config);
        var subscription = observable.subscribe(observer);

    });

    function takeName(name,len) {
        var Name = '';
        var myDate = new Date();
        var myTime = myDate.getFullYear()+myDate.getMonth()+myDate.getDate()+myDate.getHours()+myDate.getMinutes()+myDate.getSeconds();
        len = len || 1;
        if (name != ''){
            Name += name;
        }
        var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
        var maxPos = chars.length;
        for (i = 0; i < len; i++) {
            Name += chars.charAt(Math.floor(Math.random() * maxPos));
        }
        Name += myTime+Math.ceil(Math.random()*9999).toString();
        return Name;
    }
</script>

<script>
    $(document).ready(function(){
        setInterval(is_recharge,15000);
    });
    function is_recharge() {
        $.ajax({
            type: "post",
            url: "<?php echo url('money/is_recharge'); ?>",
            data: "",
            dataType: "json",
            async: false,
            success: function(data) {
                var ret = data.ret;
                var type = data.data.type;
                var name = data.data.name;
                if(ret=="200"){
                    var audio = document.createElement("audio");
                    audio.src = "URL_IMG/recharge.mp3";
                    audio.play();
                    if(type==1){
                        var msg = "您有一个新的充值订单:"+name;
                        layer.alert(msg, {
                            skin: 'layui-layer-molv' //样式类名
                            ,closeBtn: 0
                            ,anim: 4 //动画类型
                        });
                    }
                    if(type==2){
                        var msg = "您有一个新的提现订单:"+name;
                        layer.alert(msg, {
                            skin: 'layui-layer-molv' //样式类名
                            ,closeBtn: 0
                            ,anim: 4 //动画类型
                        });
                    }
                }
            }
        });
    }
</script>

<!--common scripts for all pages-->
<script src="__JS__/scripts.js"></script>
<script src="__JS__/common.js"></script>

</body>
</html>
